package com.ds.pojo;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;

import java.util.List;
import java.util.Map;

/**
 * @program: SpringBoot
 * @description:
 * @author: Dawson.Zhang
 * @create: 2020-04-12
 **/
@Component
@ConfigurationProperties(prefix = "user")
public class User {
//    @Value("${user.name}")
    String name;
//    @Value("${user.age}")
    String age;
    Map<String,Object> map;
    List<String> list;

    public User(String name, String age, Map<String, Object> map, List<String> list) {
        this.name = name;
        this.age = age;
        this.map = map;
        this.list = list;
    }

    public User() {
        System.out.println("user空餐被夹在");
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getAge() {
        return age;
    }

    public void setAge(String age) {
        this.age = age;
    }

    public Map<String, Object> getMap() {
        return map;
    }

    public void setMap(Map<String, Object> map) {
        this.map = map;
    }

    public List<String> getList() {
        return list;
    }

    public void setList(List<String> list) {
        this.list = list;
    }

    @Override
    public String toString() {
        return "User{" +
            "name='" + name + '\'' +
            ", age='" + age + '\'' +
            ", map=" + map +
            ", list=" + list +
            '}';
    }

}
